package com.coocaa.typhoon.api.config.redis;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author bijiahao
 * @date : 2025/10/21 14:16
 * @description
 */
@Data
@Component
@ConfigurationProperties(prefix = "redis")
public class RedisProperties {
    private String timeout;
    private Integer maxRedirects;
    private Integer database;
    private String password;
    private Cluster cluster;
    private Lettuce lettuce;

    @Data
    public static class Cluster {
        private String nodes;
    }

    @Data
    public static class Lettuce {
        private Pool pool;
    }

    @Data
    public static class Pool {
        /**
         * 最大活跃链接数 默认8
         */
        private Integer maxActive;
        /**
         * 最大空闲连接数 默认8
         */
        private Integer maxIdle;
        /**
         * 最小空闲连接数 默认0
         */
        private Integer minIdle;
        /**
         * 单位ms
         */
        private Integer maxWait;
    }

}
